<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<div class="block-heading">
  <h5>公司状态信息</h5>
  
  <c:if test="${not principal.supplier}">
    <a href="${ctx.host}/suppliers/${supplier.id}/supplier-business" data-target="#business-edit" data-toggle="modal" title="Edit"
       class="pull-right" style="font-size: 12px; padding-top: 20px;">编辑
    </a>
  </c:if>
  
  <c:if test="${supplierMenuType eq 'sub'}">
    <a href="javascript:void(0);" class="print pull-right" style="font-size: 12px; padding-top: 20px; margin-right: 15px;">打印</a>
  </c:if> 
</div>

<div class="row">
  <div class="col-xs-12">
  
    <div class="form-horizontal ms-form form-personal-info">
    
      <div class="form-group ms-form-group">
        <label class="control-label col-xs-3">公司类型：</label>
        <div class="col-xs-3 pull-left">
          <p class="form-control-static">${supplier.type.description}</p>
        </div>
        <label class="control-label col-xs-2">供方审核状态：</label>
        <div class="col-xs-3 pull-left">
          <p class="form-control-static">
            ${supplier.status.description}
            <c:if test="${supplier.status.rejected}">
              &nbsp;&nbsp;<i class="text-danger">${supplierEvent.reason}</i>
            </c:if>
          </p>
        </div>
      </div>

      <div class="form-group ms-form-group">
        <label class="control-label col-xs-3">挂靠管理公司：</label>
        <div class="col-xs-3 pull-left">
          <p class="form-control-static">
            <c:forEach var="parent" items="${persist.parentSupplier(supplier)}">
              ${parent.code} - ${parent.name}<br/>
            </c:forEach>
          </p>
        </div>
        
        <c:if test="${not empty supplier.syncStatus}">
          <label class="control-label col-xs-2">变更申报状态：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">
              ${supplier.syncStatus.description}
              <c:if test="${supplier.syncStatus.rejected}">
                &nbsp;&nbsp;<i class="text-danger">${changeSupplierEvent.reason}</i>
              </c:if>
            </p>
          </div>
        </c:if>
      </div>

      <div class="form-group ms-form-group">
        <label class="control-label col-xs-3"><span class="color-red">*</span>业务类型：</label>
        <div class="col-xs-3 pull-left">
          <p class="form-control-static">${empty supplier.businessTypeDescription ? '无' : supplier.businessTypeDescription}</p>
        </div>

        <label class="control-label col-xs-2"><span class="color-red">*</span>业务性质：</label>
        <div class="col-xs-3 pull-left">
          <p class="form-control-static">${empty supplier.businessNature ? '无' : supplier.businessNature.description}</p>
        </div>
      </div>

    </div>
  </div>
</div>